page.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { UserInfoRep } from "@/api/user";
  2. import { getMoneyApi } from "@/api/userWallt";
  3. import { WithDrawType } from "@/api/withdraw";
  4. import { server } from "@/utils/server";
  5. import WithdrawWidget from "./WithdrawWidget";
  6. // 获取提现配置列表
  7. // POST /v1/api/user/user_withdraw_config
  8. // 接口ID:222886924
  9. // 接口地址:https://app.apifox.com/link/project/4790544/apis/api-222886924
  10. const getWithdrawApi = async () => {
  11. return server
  12. .request<WithDrawType[]>({
  13. url: "/v1/api/user/user_withdraw_config",
  14. method: "post",
  15. })
  16. .then((res) => {
  17. if (res.code === 200) {
  18. return res.data;
  19. }
  20. return [];
  21. });
  22. };
  23. const getUserInfo = async () => {
  24. return server
  25. .request<UserInfoRep>({
  26. url: "/v1/api/user/user_info",
  27. method: "POST",
  28. next: { revalidate: 0 },
  29. })
  30. .then((res) => {
  31. if (res.code === 200) return res.data;
  32. return {};
  33. });
  34. };
  35. const Page = async () => {
  36. const data = await getWithdrawApi();
  37. const wallet = await getMoneyApi();
  38. const userInfo = await getUserInfo();
  39. return <WithdrawWidget channels={data} wallet={wallet} playlist={userInfo.play_list} />;
  40. };
  41. export default Page;